#ifndef RPLEAF_H
#define RPLEAF_H

#include "RPTree.h"
#include "RPTreeParam.h"

#include <vector> //vector

using namespace std;

class RPLeaf : public RPTree
{
	protected:
		unsigned int id;

	public:
		// Constucteur
		RPLeaf( const RPTreeParam &param,
			vector<unsigned int> &dataIdx,
			list< list<unsigned int> > &leavesContent,
			unsigned int depth,
			unsigned int &id);

		// Constructeur pour reconstruction depuis sauvegarde
		RPLeaf( unsigned int depth, unsigned int &id, vector<double> &v );

		// Constructeur pour wrapper C
		RPLeaf( unsigned int depth, unsigned int &id );

		// Operateur de conversion vers string
		virtual operator string() const;

		// Sauvegarde de l'arbre
		virtual void save( ostream &out ) const;

		// Test d'une valeur
		virtual unsigned int use(double *data) const;

		// Récupération de l'instance
		virtual const RPLeaf *get_leaf_by_id(unsigned int id) const;

		// Accessors ( for C Wrapper )
		unsigned int get_id() const;
};

#endif
